/*
 * @Description:
 * @Version: 1.0.0
 * @Author: gyh
 * @Date: 2021-08-17 22:33:44
 * @LastEditors: gyh
 * @LastEditTime: 2021-08-17 22:35:29
 */
import Cookies from 'js-cookie'

const TokenKey = 'token'
const RefreshTokenKey = 'refresh-token'

export const setToken = (token: string) => {
  return Cookies.set(TokenKey, token)
}

export const getToken = () => {
  return Cookies.get(TokenKey)
}

export const setRefreshToken = (refreshToken: string) => {
  return Cookies.set(RefreshTokenKey, refreshToken)
}

export const getRefreshToken = () => {
  return Cookies.get(RefreshTokenKey)
}

export const removeToken = () => {
  Cookies.remove(TokenKey)
  Cookies.remove(RefreshTokenKey)
}
